package com.bupt.ilink.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.bupt.ilink.entity.Studyspace.CourseSource;
import com.bupt.ilink.entity.Studyspace.DTO.CourseResponse;
import com.bupt.ilink.entity.Studyspace.DTO.StudyCourseFileResponse;
import com.bupt.ilink.entity.Studyspace.DTO.StudySourceFileResponse;
import com.bupt.ilink.entity.Studyspace.StudyCourseFile;
import com.bupt.ilink.entity.Studyspace.StudyTeacherCourse;
import com.bupt.ilink.utils.R;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.concurrent.CompletableFuture;

public interface StudyaboutTeacherService extends IService<StudyTeacherCourse> {
    @Transactional
    boolean createCourseWithFolder(String userid, CourseResponse newTeacherCourse, List<MultipartFile> files) throws Exception;

//    boolean deleteCoursefile(Long courseFileId,Long courseId) throws Exception;
    boolean updateCourseById(String userId, Long courseId, CourseResponse updatedTeacherCourse,
                         List<MultipartFile> files);
    boolean deleteCourse(Long course_id);

    boolean createChapter(String fileName, Long courseId) throws Exception;
    boolean newcreateChapter(String fileName, Long courseFileId, Integer sortOrder) throws Exception;

    List<StudyCourseFileResponse> getUserCourseResourceTree(String userId);
    StudyCourseFileResponse getCourseTree(String userId, Long courseId);

    List<StudyCourseFileResponse> getCourseFiles(Long courseFileId,String sentence);

    List<StudySourceFileResponse> getSourseFiles(Long courseFileId,String sentence);

    //递归删除文件夹下对应的所有子文件夹和资源
    @Transactional
    boolean deleteCoursefileBycourseFile(Long courseFileId,Long courseId) throws Exception;

    boolean deleteSourcesfile(Long sourceId, String type) throws Exception;

    List<String> getCommonTags();

    List<StudyCourseFileResponse> getUserCourseByuserId(String userId,String sentence);

    R handlefileTrans(CourseSource courseSource, String fileUrl);

    List<StudySourceFileResponse> getSourseFilesALL(String userId,String sentence);

    CompletableFuture<Void> checkVideoStatusAsync(Long courseSourceId);




//    R tongyihandle(String fileUrl, Long filesourceId);
}
